package com.hejjon.core.utils;

import com.hejjon.core.bean.TreeNode;
import com.hejjon.core.domain.entity.BasicType;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author: cs
 * @date: 2025-02-26 15:39:53
 * @since: 1.0
 */
public class Test {


    public static void main1(String[] args) {
        List<String> ids = new ArrayList<>();
        ids.add("");
        ids.add("");
        ids.add("123");
        ids.add(null);
        ids.add("abcd");
        ids.add("dssfd");

        List<String> result = ids.stream()
                .filter(item -> item != null && item.length() > 0)
                .collect(Collectors.toList());
        System.out.println(result);
    }


    public static void main(String[] args) throws Exception {
        BasicType bt = new BasicType();
        bt.setId("123");
        bt.setName("test1");

        String serialize = SerializeUtil.serialize(bt);

        System.out.println(serialize);

        BasicType b = SerializeUtil.deserialize(serialize);
        System.out.println(b);
    }

}
